package com.bobo.myapplication.activity;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;

import com.bobo.myapplication.R;
import com.bobo.myapplication.utils.ToastUitl;

/**
 * Created by ZJB on 2018/1/11.
 *
 * @ copyright: iwhere chengdu technology
 */

public class ToastCustomActivity extends BaseActivity{

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_toast_custom);
        ToastUitl.getInstance().initToastUtil(this);
    }

    
    public static void start(Context context) {
        Intent starter = new Intent(context, ToastCustomActivity.class);
        context.startActivity(starter);
    }
    
    public void onClick(View view){
        switch (view.getId()){
            case R.id.btn_1://自定义样式的toast
                ToastUitl.getInstance()
                        .setGravity(Gravity.CENTER)
                        .setContentView(LayoutInflater.from(ToastCustomActivity.this).inflate(R.layout.toast_item,null))
                        .setText(R.id.tv_content,"大家好哇，哈哈")
                        .showViewShort();
                break;
            case R.id.btn_2://自定义位置的toast
                break;
            case R.id.btn_3://自定义可以拖动的toast
                break;

        }
    }
}
